package com.hujiheng.paike.service.impl;

import com.hujiheng.paike.mapper.TeacherMapper;
import com.hujiheng.paike.pojo.Teacher;
import com.hujiheng.paike.service.TeacherService;
import com.hujiheng.paike.view.TeacherView;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TeacherServiceImpl implements TeacherService {
    @Autowired
    private TeacherMapper teacherMapper;

    @Override
    public List<TeacherView> getTeacherList() {
        return teacherMapper.getTeacherList();
    }

    @Override
    public Teacher getById(int teacherId) {
        return teacherMapper.getById(teacherId);
    }

    @Override
    public List<Teacher> getTeachersByName(String teacherName) {
        return teacherMapper.getTeachersByName(teacherName);
    }

    @Override
    public List<Teacher> getTeachersLikeName(String teacherName) {
        return teacherMapper.getTeachersLikeName(teacherName);
    }

    @Override
    public List<Teacher> getTeachersByCourseId(int courseId) {
        return teacherMapper.getTeachersByCourseId(courseId);
    }

    @Override
    public int addTeacher(Teacher teacher) {
        return teacherMapper.addTeacher(teacher);
    }

    @Override
    public int updateTeacher(Teacher teacher) {
        return teacherMapper.updateTeacher(teacher);
    }

    @Override
    public int deleteTeacher(int teacherId) {
        return teacherMapper.deleteTeacher(teacherId);
    }
}
